package hk.linkcredit.awardservice.common.constant;

import lombok.Getter;

/**
 * <p>
 * 状态码封装
 * </p>
 *
 * @author yangkai.shen
 * @date Created in 2018-10-02 21:02
 */
@Getter
public enum Status {
    /**
     * 操作成功
     */
    OK(200, "操作成功"),

    /**
     * 未知异常
     */
    UNKNOWN_ERROR(500, "服务器出错啦"),

    // 100000 系统异常
    SYSTEM_ERR(100001, "Bad connection.Please try again."),
    // REQUEST_ERR(100002", "网络异常，请稍候重试"),
    REQUEST_ERR(100002, "Internet exception, Please try again."),
    // SYSTEM_BUSY(100003", "系统繁忙，请稍候重试"),
    SYSTEM_BUSY(100003, "System is busy.Please try again."),
    // ip地址错误，请更换IP地址。
    // NOT_WHITE_IP(100004, "请求地址不在白名单内"),
    NOT_WHITE_IP(100004, "IP address error, please change the IP address."),
    SYSTEM_EXCEPTION(100005, "System abnormal, please try again later."),

    DB_OPERATION_FAILED(100005, "database operation failed.");



    /**
     * 状态码
     */
    private Integer code;
    /**
     * 内容
     */
    private String message;

    Status(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
